<% title_tag "#{@user.name} - #{t(".Notes")}" %>

<div class="flex-wrap">
  <div class="aside-wrap">
    <%= render "/users/sidebar" %>
  </div>
  <div class="main-wrap">
    <div class="main-content">
      <div class="user-notes">
        <h2 class="sub-title">
          <span class="title"><%= t(".Notes") %></span>
          <%= link_to t(".New Note"), new_note_path, class: "btn btn-primary btn-sm float-right" %>
        </h2>
        <% if @notes.blank? %>
        <div class="blankslate no-data no-note">
          <p><%= t(".No notes") %></p>
        </div>
        <% else %>
        <ul class="cards-container recent-notes">
          <% @notes.each do |note| %>
            <li class="card recent-note-item mb-2">
              <div class="title">
                <%= note_title_tag(note) %>
                <% if note.private? %>
                  <span class="label label-private icon-middle-wrap ml-2"><%= icon_tag("lock") %><%= t(".Private") %></span>
                <% end %>
              </div>
              <% if note.description.present? %>
              <div class="description">
                <%= note.description %>
              </div>
              <% end %>
              <div class="info">
                <%= timeago note.body_updated_at %>
              </div>
              <div class="action action-icon">
                <% if can? :update, note %>
                  <%= link_to icon_tag("edit"), note.to_path("/edit"), class: "btn-edit" %>
                <% end %>
                <% if can? :delete, note %>
                  <%= link_to icon_tag("trash"), note.to_path, class: "btn-delete", data: { method: :delete, confirm: t(".Are you sure delete?") }  %>
                <% end %>
              </div>
            </li>
          <% end %>
        </ul>
        <% end %>
      </div>
      <%= paginate @notes %>
    </div>
  </div>
</div>